﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>宾果高校</title>
    <link rel="stylesheet" href="/static/css/angularStyle.css" />
    <link rel="stylesheet" href="/static/css/styles.css">
    <link rel="stylesheet" href="/static/css/ng-pagination.min.css" />
    <link rel="stylesheet" href="/static/css/sweetalert.min.css" />
    <link rel="stylesheet" href="/static/css/jquery.datetimepicker.css" />
    <!--<script src="./static/js/bundle.js"></script>-->
</head>
<body>
    <div id="divHeader"></div>
    <div class="main" ng-app="myApp">
        <div class="container pr">
            <div class="clearfix">
                <div class="home-module-l">
                    <div id="divCondition">
                        <div class="header">
                            <div class="clearfix">

                            </div>
                        </div>
                        <div class="tabbar">
                            <ul class="clearfix tabbar-ul">
                                <li class="current">
                                    <a href="javascript:void(0)" onclick="Go('All')">所有发布</a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)" onclick="Go('Student')">社团筹备</a>
                                </li>
                                <li>
                                    <a href="javascript:void(0)" onclick="Go('Company')">企业赞助</a>
                                </li>
                            </ul>
                        </div>
                        <div class="filter pr">
                            <ul class="filter-choose">
                                <li>
                                    <span>活动地区：</span>
                                    <a href="javascript:void(0)" name="Area" value="" class="chosen">不限</a>
                                    <a href="javascript:void(0)" id="btnDefaultArea" name="Area" value="300000">广州市</a>
                                    <a href="javascript:void(0)" name="Area" value="300005">深圳市</a>
                                    <a href="javascript:void(0)" name="Area" value="300009">东莞市</a>
                                    <a href="javascript:void(0)" name="Area" value="300001">汕头市</a>
                                    <a href="javascript:void(0)" name="Area" value="300002">湛江市</a>
                                    <a href="javascript:void(0)" name="Area" value="300003">潮州市</a>
                                    <a href="javascript:void(0)" name="Area" value="300004">茂名市</a>
                                    <a href="javascript:void(0)" name="Area" value="300006">韶关市</a>
                                    <a href="javascript:void(0)" name="Area" value="300007">梅州市</a>
                                    <a href="javascript:void(0)" name="Area" value="300008">惠州市</a>
                                    <a href="javascript:void(0)" name="Area" value="300010">江门市</a>
                                    <a href="javascript:void(0)" name="Area" value="300011">佛山市</a>
                                    <a href="javascript:void(0)" name="Area" value="300012">肇庆市</a>
                                    <a href="javascript:void(0)" name="Area" value="300013">珠海市</a>
                                    <a href="javascript:void(0)" name="Area" value="300014">中山市</a>
                                    <a href="javascript:void(0)" name="Area" value="300016">汕尾市</a>
                                    <a href="javascript:void(0)" name="Area" value="300017">阳江市</a>
                                    <a href="javascript:void(0)" name="Area" value="300018">清远市</a>
                                    <a href="javascript:void(0)" name="Area" value="300019">揭阳市</a>
                                    <a href="javascript:void(0)" name="Area" value="300020">云浮市</a>
                                    <!--<a id="showMoreArea" href="javascript:;" class="main-color">更多</a>-->
                                </li>
                                <!--<div class="more-area">
                                    <a href="javascript:void(0)" name="Area" value="300008">惠州市</a>
                                    <a href="javascript:void(0)" name="Area" value="300010">江门市</a>
                                    <a href="javascript:void(0)" name="Area" value="300011">佛山市</a>
                                    <a href="javascript:void(0)" name="Area" value="300012">肇庆市</a>
                                    <a href="javascript:void(0)" name="Area" value="300013">珠海市</a>
                                    <a href="javascript:void(0)" name="Area" value="300014">中山市</a>
                                    <a href="javascript:void(0)" name="Area" value="300016">汕尾市</a>
                                    <a href="javascript:void(0)" name="Area" value="300017">阳江市</a>
                                    <a href="javascript:void(0)" name="Area" value="300018">清远市</a>
                                    <a href="javascript:void(0)" name="Area" value="300019">揭阳市</a>
                                    <a href="javascript:void(0)" name="Area" value="300020">云浮市</a>
                                </div>-->
                                <li>
                                    <span>活动类型：</span>
                                    <a href="javascript:void(0)" name="ActivityType" value="" class="chosen">不限</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000040">招新类</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000041">文艺类</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000042">表演类</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000043">晚会类</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000044">体育类</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000045">讲座类</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000046">比赛类</a>
                                    <a href="javascript:void(0)" name="ActivityType" value="900000047">其它</a>
                                </li>
                                <li>
                                    <span>活动规模：</span>
                                    <a href="javascript:void(0)" name="StudentInterval" value="" class="chosen">不限</a>
                                    <a href="javascript:void(0)" name="StudentInterval" value="900000003">0-100人</a>
                                    <a href="javascript:void(0)" name="StudentInterval" value="900000004">101-300人</a>
                                    <a href="javascript:void(0)" name="StudentInterval" value="900000005">301-500人</a>
                                    <a href="javascript:void(0)" name="StudentInterval" value="900000006">501-1000人</a>
                                    <a href="javascript:void(0)" name="StudentInterval" value="900000007">1001-1500人</a>
                                    <a href="javascript:void(0)" name="StudentInterval" value="900000010">1500人以上</a>
                                </li>
                                <li style="padding: 6px 18px;" class="clearfix">
                                    <div class="form-group clearfix fl mt4">
                                        <label for="">赞助金额：</label>
                                        <select id="SponsorMoney" class="mt2">
                                            <option value="">请选择...</option>
                                            <option value="900000011">500-2500</option>
                                            <option value="900000012">2501-5000</option>
                                            <option value="900000013">5000-7500</option>
                                            <option value="900000014">7501-10000</option>
                                            <option value="900000015">10001-15000</option>
                                            <option value="900000016">15001-20000</option>
                                            <option value="900000017">20001-25000</option>
                                            <option value="900000018">25001-30000</option>
                                            <option value="900000019">30001-50000</option>
                                            <option value="900000020">50001-70000</option>
                                            <option value="900000021">70001-100000</option>
                                            <option value="900000022">100001-150000</option>
                                            <option value="900000023">150001-200000 </option>
                                            <option value="900000024">200000以上</option>
                                        </select>
                                    </div>
                                    <div style="margin-left: 22px;margin-top: 3px;" class="form-group clearfix fl">
                                        <label for="">活动时间：</label>
                                        <input id="StartDate" type="text" style="width: 130px;"><span>　— </span>
                                        <input id="EndDate" type="text" style="width: 130px;">
                                    </div>
                                    <a href="javascript:void(0)" onclick="Go();" class="choseTimeSubmit">提交</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div ng-controller="projectCtrl" ng-cloak>
                        <div class="campaign">
                            <div id="divCount">
                                <div class="filter-result" ng-model="count">
                                    <p ng-if="count > 0">你好，“活动”相关的发布信息以为你找到<i class="filter-r-num">{{count}}</i>条，请详细浏览</p>
                                    <p ng-if="count == 0">未找到符合条件的记录，换个条件试试</p>
                                    <p ng-if="count == undefined">选择你想要查找的条件，试试好运气</p>
                                </div>
                            </div>
                            <ul class="clearfix">
                                <li ng-repeat="x in names">
                                    <a class="img-list" href="/release-detail.html?id={{x.ProjectID}}">
                                        <img src="{{x.Cover}}" alt="">
                                        <div class="campaign-hide">
                                            <div class="wrap">
                                                <!-- <div>
                                                    <p class="colorWhite">{{x.ProjectName}}</p>
                                                </div> -->
                                                <div class="clearfix"><!-- <span class="fl colorWhite">{{x.CreatorName}}</span> --><span class="">{{x.PastDays}}</span></div>
                                                <div><span class="colorWhite">{{x.CreatorType == 'Company' ? '提供赞助金' : '所需赞助金'}}：￥{{x.Amount}}</span></div>
                                                <div><span>活动时间：<br />{{x.StartDate | date:'yyyy/MM/dd'}}-{{x.EndDate | date:'yyyy/MM/dd' }}</span></div>
                                            </div>
                                        </div>
                                    </a>
                                    <a href="/org-detail.html?id={{x.CreatorBelongID}}&type={{x.CreatorType}}">
                                        <div class="clearfix">
                                            <h3 class="fl perpare-maintext-left">{{x.ProjectName}}</h3><span class="fr main-color perpare-maintext-right">{{x.CreatorType == 'Company' ? '社团征集中' : '赞助招募中'}}</span>
                                        </div>
                                        <div class="clearfix"><span class="fl colorGray perpare-maintext-left">{{x.CreatorName}}</span><span class="fr main-color wrapCollect perpare-maintext-right">{{x.Favorites}}</span></div>
                                    </a>
                                </li>
                            </ul>
                        </div>
                        <div class="page">
                            <div class="pager center">
                                <pager page-count="pageCount" current-page="currentPage" on-page-change="onPageChange()" first-text="首页" next-text="下一页" prev-text="上一页" last-text="尾页"></pager>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="home-module-r" ng-cloak>
                    <div class="recent">
                        <div class="recent-title">
                            <h2>最近浏览</h2>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="recent-main pr">
                        <ul ng-controller="cachedProjectCtrl">
                            <li ng-repeat="x in names">
                                <a href="/release-detail.html?id={{x.ProjectID}}">
                                    <img src="{{x.Cover}}" alt="">
                                    <div class="campaign-hide">
                                        <div class="wrap">
                                            <!--  <div>
                                                <p class="colorWhite">{{x.ProjectName}}</p>
                                            </div> -->
                                            <div class="clearfix"><!-- <span class="fl colorWhite">{{x.CreatorName}}</span> --><span class="fl">{{x.PastDays}}</span></div>
                                            <div><span class="colorWhite">{{x.CreatorType == 'Company' ? '提供赞助金' : '所需赞助金'}}：￥{{x.Amount}}</span></div>
                                            <div><span>活动时间：<br />{{x.StartDate | date:'yyyy/MM/dd'}}-{{x.EndDate | date:'yyyy/MM/dd' }}</span></div>
                                        </div>
                                    </div>
                                </a>
                                <a href="/org-detail.html?id={{x.CreatorBelongID}}&type={{x.CreatorType}}">
                                    <div class="clearfix">
                                        <h3 class="fl">{{x.ProjectName}}</h3><span class="fr main-color">{{x.CreatorType == 'Company' ? '社团征集中' : '赞助招募中'}}</span>
                                    </div>
                                    <div class="clearfix"><span class="fl colorGray">{{x.CreatorName}}</span><span class="fr main-color wrapCollect">{{x.Favorites}}</span></div>
                                </a>
                            </li>
                        </ul>
                        <div class="view-more">
                            <a href="javascript:void(0)">更多内容请进入社团/企业查询</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="home-module">
                <img src="/static/images/banner-bottom.jpg" alt="">
                <div class="asideBottom">
                    <a class="" href="#topbar">
                        <img src="/static/images/scrolltop.png" alt="">
                        <p>回到顶部</p>
                    </a>
                    <a href="index.html">
                        <img src="/static/images/backhome.png" alt="">
                        <p>返回首页</p>
                    </a>
                    <a class="">
                        <img src="/static/images/contactus.png" alt="">
                        <p>联系我们</p>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div id="divFooter"></div>
    <script type="text/javascript" src="/static/js/ref/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="/static/js/self/common.js"></script>
    <script type="text/javascript" src="/static/js/ref/angular.min.js"></script>
    <script type="text/javascript" src="/static/js/ref/ng-pagination.min.js"></script>
    <script type="text/javascript" src="/static/js/ref/store.min.js"></script>
    <script type="text/javascript" src="/static/js/ref/sweetalert.min.js"></script>
    <script type="text/javascript" src="/static/js/ref/jquery.datetimepicker.full.min.js"></script>
    <script>

        $("#divFooter").load("wuc/footer.html");
        $("#divHeader").load("/wuc/header.html", function () {
            var userType = param.type == "Company" ? 1 : 2;
            CheckUser(userType);
        });


        //common.commonAjax({ type: 'Get', url: 'api/project/ListTest', sMethod: AfterTestCompleted });
        //function AfterTestCompleted(ctx) {
        //    debugger;
        //    if (ctx == null) {
        //        alert(123);
        //    }
        //}

        var values, searchFrom;

        var myApp = angular.module('myApp', ['ng-pagination']);

        common.CreatePagingCtrl({ name: 'projectCtrl', limit: 12, pageChanged: ChangePage, app: myApp });

        common.CreateController({ name: 'cachedProjectCtrl', objType: "list", app: myApp });

        function Go(from) {

            values = common.GetCtrlValues({
                ContentID: "divCondition"
            })

            if (!common.checkValue(values.SchoolName) && !common.checkValue(values.Area) && !common.checkValue(values.ActivityType) && !common.checkValue(values.StudentInterval)
                && !common.checkValue(values.SponsorMoney) && !common.checkValue(values.StartDate) && !common.checkValue(values.EndDate)) {

                var ele = document.querySelector("[ng-controller=projectCtrl]");
                angular.element(ele).scope().update({});
                return;
            }


            if (common.checkValue(from))
                searchFrom = from;

            values.SearchFrom = searchFrom == "All" ? "" : searchFrom;
            values.Limit = 12;
            values.Start = 1;

            common.commonAjax({ type: 'Post', url: 'api/project/Search', data: values, sMethod: AfterCompleted });
        }

        $(".filter-choose li a").on('click', function (e) {
            var self = $(this);
            self.siblings().removeClass('chosen');
            self.addClass('chosen');
            Go();
        });

        var param = common.getUrlArgStr();
        if (common.checkValue(param.sn)) {
            $("#SchoolName").val(unescape(param.sn));
            Go('All');
        }
        else {
            $("#btnDefaultArea").click();
        }


        function AfterCompleted(ctx) {
            if (ctx == null) {
                common.alertMessage("无数据.");
                return;
            }

            var ele = document.querySelector("[ng-controller=projectCtrl]");

            angular.element(ele).scope().update(ctx);

            //$("#divCount").show();
        }

        function ChangePage($scope) {

            values.Start = $scope.currentPage;

            common.commonAjax({ type: 'Post', url: 'api/project/Search', data: values, sMethod: AfterCompleted });
        }

        function ListCacheProject() {

            var ele = document.querySelector("[ng-controller=cachedProjectCtrl]");

            var data = common.ListCacheObj("Project");

            if (common.checkValue(data))
                angular.element(ele).scope().update(data);
        }

        $(function () {

            ListCacheProject();

            //显示更多
            $('#showMoreArea').on('click', function () {
                $('.more-area').toggle()
            })
            //登录框下拉
            $('.link-login').on('click', function (e) {
                $(this).toggleClass('on');
            });
            //社区模块切换样式
            $('.tabbar-ul li').on('click', function (e) {
                var self = $(this);
                self.siblings().removeClass('current');
                self.addClass('current');
            });
            //选择地区


            $("#SponsorMoney").change(function () {
                Go();
            })

            $.datetimepicker.setLocale('ch');//设置语言
            $('#StartDate').datetimepicker({
                timepicker: false,
                format: 'Y-m-d'
            });
            $('#EndDate').datetimepicker({
                timepicker: false,
                format: 'Y-m-d'
            });

        });
    </script>
</body>
</html>